//
//  BarCodeViewController.m
//  Weibo
//
//  Created by wpapple on 16/6/1.
//  Copyright © 2016年 wpapple. All rights reserved.
//

#import "BarCodeViewController.h"

@interface BarCodeViewController ()
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *scanlineConstraint;

@end

@implementation BarCodeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   //计时器
    CADisplayLink *line = [CADisplayLink displayLinkWithTarget:self selector:@selector(scan)];
    
    [line addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
}

-(void)scan
{
    self.scanlineConstraint.constant += 3;
    
    if (self.scanlineConstraint.constant >= 100) {
        self.scanlineConstraint.constant = -100;
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
